package com.woniuxy.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniuxy.model.PawnGoodsAttrRel;
import com.woniuxy.service.PawnGoodsAttrRelService;
import com.woniuxy.utils.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hujianying
 * @since 2022-03-23
 */
@RestController
@RequestMapping("/pawnGoodsAttrRel")
public class PawnGoodsAttrRelController {

    @Resource
    private PawnGoodsAttrRelService pawnGoodsAttrRelService;

    @GetMapping("/getAttrByGoodsId")
    @ResponseBody
    public Result getAttrByGoodsId(Integer goodsId){
        List<PawnGoodsAttrRel> result = pawnGoodsAttrRelService.list(new QueryWrapper<PawnGoodsAttrRel>()
                .eq("goods_id", goodsId));
        return Result.success(200,"getAttrByGoodsId成功",result);
    }
}

